package light.head.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import light.head.constant.Sys;

import org.hibernate.annotations.Formula;

/**
 * 离职申请表
 */
@Entity
@Table
public class Resignation implements Serializable{

	private static final long serialVersionUID = 5374378410681146794L;
	
	private Integer code;				// 流水号
	private String reason;				// 离职原因
	private Date ct;					// 创建时间
	private Integer oc;					// 机构编号
	private Boolean deleted = false;	// 是否删除
	private Date ft;					// 预计离职时间
	private Integer cu;					// 创建人
	private Boolean quit = false;		// 是否离职
	private Date qt;					// 实际离职时间
	private Boolean head = false;		// 是否是负责人
	private Byte pass = Sys.B_ONE;			//状态（1.未审核2.不通过3.通过4.审核中）
	private String remark;
	private String cn;
	private String on;
	List<AuditStatus> auditStatusList;		// 审核状态
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getReason() {
		return reason;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getQt() {
		return qt;
	}
	@Column
	public Boolean getQuit() {
		return quit;
	}
	@Column
	public Boolean getHead() {
		return head;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu)")
	public String getCn() {
		return cn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getFt() {
		return ft;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Byte getPass() {
		return pass;
	}
	@Transient
	public List<AuditStatus> getAuditStatusList() {
		return auditStatusList;
	}
	@Column
	public String getRemark() {
		return remark;
	}
	
	
	
	
	
	
	public void setOn(String on) {
		this.on = on;
	}
	public void setHead(Boolean head) {
		this.head = head;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setPass(Byte pass) {
		this.pass = pass;
	}
	public void setAuditStatusList(List<AuditStatus> auditStatusList) {
		this.auditStatusList = auditStatusList;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setQuit(Boolean quit) {
		this.quit = quit;
	}
	
	public void setQt(Date qt) {
		this.qt = qt;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setFt(Date ft) {
		this.ft = ft;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCode(Integer code) {
		this.code = code;
	}


	public void setReason(String reason) {
		this.reason = reason;
	}

	public void setCt(Date ct) {
		this.ct = ct;
	}

	

}
